package com.yf.starter;

import com.yf.Utils.SpringContextHolder;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author chentianwei
 * @date 2022/11/11 9:36
 * @description 启动类
 */
@SpringBootApplication(scanBasePackages = {"com.yf.*"})
@EnableTransactionManagement
@ConfigurationPropertiesScan(basePackages = "com.yf.config.*")
@MapperScan(basePackages = {
        "com.yf.dao",
        "com.yf.quartz.dao"})
public class SaaSAppStarter {
    public static void main(String[] args) {
        SpringApplication.run(SaaSAppStarter.class, args);
    }

    /**
     * 注入上下文容器
     * @return 容器
     */
    @Bean
    public SpringContextHolder springContextHolder() {
        return new SpringContextHolder();
    }
}
